<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});


Route::namespace('Api')->middleware('httplog')->group(function (\Illuminate\Routing\Router $api) {

    $api->any('login','LoginController@smsLogin')->name('login');//验证码登录
    $api->get('sms','SmsController@send')->middleware('throttle:1,1')->name('sendSMS');//发送短信验证码
    $api->get('order','OrderController@create');

    $api->group(['middleware'=>'auth:api'],function($api){
        $api->get('user','UserController@user');//用户基本信息



    });
});


